package homework.test1.Service;

import homework.test1.Dao.LoginDao;
import homework.test1.Domain.User;

import java.util.ArrayList;

public class LoginService {
    private LoginDao loginDao = new LoginDao();
    public int isExist(String name) {
        int index = loginDao.isExist(name);
        return index;
    }

    public boolean addUser(User user) {
        boolean flag = loginDao.addUser(user);
        return flag;
    }

    public ArrayList<User> find() {
        ArrayList<User> list = loginDao.find();
        return list;
    }

    public User getUser(int index) {
        User user = loginDao.getUser(index);
        return user;
    }
}
